linkLabel([str or fn]) | Link object accessor function or attribute for name (shown in label). Supports plain text or HTML content. Note that this method uses innerHTML internally, so make sure to pre-sanitize any user-input content to prevent XSS vulnerabilities. | name |
linkVisibility([boolean, str or fn]) | Link object accessor function, attribute or a boolean constant for whether to display the link line. A value of false maintains the link force without rendering it. | true |
linkColor([str or fn]) | Link object accessor function or attribute for line color. | color |
linkAutoColorBy([str or fn]) | Link object accessor function (fn(link) ) or attribute (e.g. 'type' ) to automatically group colors by. Only affects links without a color attribute. | |
linkLineDash([num[], str or fn]) | Link object accessor function, attribute or number array (e.g. [5, 15] ) to determine if a line dash should be applied to this rendered link. Refer to the HTML canvas setLineDash API for example values. Either a falsy value or an empty array will disable dashing. | null |
linkWidth([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the link line width. Keep in mind that link widths remain visually contant through various zoom levels, where as node sizes scale relatively. | 1 |
linkCurvature([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the curvature radius of the link line. Curved lines are represented as bezier curves, and any numeric value is accepted. A value of 0 renders a straight line. 1 indicates a radius equal to half of the line length, causing the curve to approximate a semi-circle. For self-referencing links (source equal to target ) the curve is represented as a loop around the node, with length proportional to the curvature value. Lines are curved clockwise for positive values, and counter-clockwise for negative values. Note that rendering curved lines is purely a visual effect and does not affect the behavior of the underlying forces. | 0 |
linkCanvasObject([fn]) | Callback function for painting a custom canvas object to represent graph links. Should use the provided canvas context attribute to perform drawing operations for each link. The callback function will be called for each link at every frame, and has the signature: .linkCanvasObject(<link>, <canvas context>, <current global scale>) . | default link object is a line, styled according to width and color . |
linkCanvasObjectMode([str or fn]) | Link object accessor function or attribute for the custom drawing mode. Use in combination with linkCanvasObject to specify how to customize links painting. Possible values are: replace : the link is rendered using just linkCanvasObject .before : the link is rendered by invoking linkCanvasObject and then proceeding with the default link painting.after : linkCanvasObject is applied after the default link painting takes place. Any other value will be ignored and the default drawing will be applied. | () => 'replace' |
linkDirectionalArrowLength([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the length (in px ) of the arrow head indicating the link directionality. The arrow is displayed directly over the link line, and points in the direction of source > target . A value of 0 hides the arrow. | 0 |
linkDirectionalArrowColor([str or fn]) | Link object accessor function or attribute for the color of the arrow head. | color |
linkDirectionalArrowRelPos([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the longitudinal position of the arrow head along the link line, expressed as a ratio between 0 and 1 , where 0 indicates immediately next to the source node, 1 next to the target node, and 0.5 right in the middle. | 0.5 |
linkDirectionalParticles([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the number of particles (small circles) to display over the link line. The particles are distributed equi-spaced along the line, travel in the direction source > target , and can be used to indicate link directionality. | 0 |
linkDirectionalParticleSpeed([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the directional particles speed, expressed as the ratio of the link length to travel per frame. Values above 0.5 are discouraged. | 0.01 |
linkDirectionalParticleWidth([num, str or fn]) | Link object accessor function, attribute or a numeric constant for the directional particles width (diameter). | 4 |
linkDirectionalParticleColor([str or fn]) | Link object accessor function or attribute for the directional particles color. | color |
emitParticle(link) | An alternative mechanism for generating particles, this method emits a non-cyclical single particle within a specific link. The emitted particle shares the styling (speed, width, color) of the regular particle props. A valid link object that is included in graphData should be passed as a single parameter. | |